package com.aerfafish.spider.neo4j.repository;

import com.aerfafish.spider.neo4j.dao.CompanyManageFund;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;

public interface CompanyManageFundRepository extends Neo4jRepository<CompanyManageFund, Long> {

    @Query("merge (company:Company{code: $companyCode}) " +
            "merge (fund:Fund{code: $fundCode})" +
            "merge p = (company) - [r:COMPANY_MANAGE_FUND] -> (fund)")
    void save(@Param("companyCode") String companyCode, @Param("fundCode") String fundCode);
}
